/**
 * 
 */
package STUDENTS.TRANTHAIHA.DEMO;

import java.util.Scanner;

/**
 * @author Administrator
 *
 */
public class namthang {
	 
	public static void main(String[] args) {
		int thang;
		int nam ;
		boolean rt = false;
		System.out.println("hay nhap gia tri cua thang");
		Scanner scan = new Scanner(System.in);
		thang=scan.nextInt();
		
		System.out.println("hay nhap gia tri cua nam");
//		Scanner scan = new Scanner(System.in);
		nam=scan.nextInt();
		
		
		
		
		if (thang > 12 && thang <1){
	    	System.out.println("ban nhap sai thang");
	    }
		if (nam % 4==0){
			if (nam % 100 ==0){
				System.out.println("nam " + nam + " la nam nhuan" );
				rt=true;
			}
			else  if (nam % 400==0){
				System.out.println("nam " + nam + " la nam nhuan" );
				rt=true;
			}
		}
		
		switch (thang){
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
		     System.out.println("thang " + thang + "co 31 ngay");break;
		case 2:
			
			if (rt==true){
				System.out.println("thang" + thang + "co 28 ngay");
			}
			else {
				System.out.println("thang" + thang + "co 29 ngay");

			}
			break;
		default:
			System.out.println("thang" + thang + " co 30 ngay");break;

		}
		
		
	} 
}
